
<%@ page import="java.sql.*" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>

<head>

    <title>个人中心</title>
    <link rel="stylesheet" href="css/bookstrap.css">

    <script src="js/jquery.min.js"></script>
    <script src="js/bookstrap.js"></script>
    <script src="js/bookstrap.bundle.js"></script>
    <style>
        .container{
            margin-top: 20px;
        }
    </style>

</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <h3 style="text-align: center">欢迎进入文献管理系统</h3>

            <table class="table table-striped">
                <thead>
                <th>ID</th>
                <th>用户名</th>
                <th>链接</th>
                <th>操作</th>
                </thead>
                <tbody>

<%
//修改requset中数据编码
    request.setCharacterEncoding("utf-8");
    String username =request.getParameter("username");
    String password =request.getParameter("password");
    String gender  =request.getParameter("gender");

    Class.forName("com.mysql.jdbc.Driver");


    String url="jdbc:mysql://localhost:3306/book";

    Connection connection=DriverManager.getConnection(url,"root","root");


    String sql ="select * from wenxian ";

   //String sql="delete from user where id=3";

    //String sql = "update user set name=? where age=?";

    //String sql="insert into user(username,password,gender,age)values(?,?,?,?)";

    PreparedStatement ps =connection.prepareStatement(sql);


    ResultSet rs=ps.executeQuery();

    while (rs.next()){
        out.print("<tr>");
        out.print(
                "<td>"+rs.getInt("id")+"</td>"
                +"<td>"+rs.getString("username")+"</td>"
                +"<td>"+rs.getString("lianjie")+"</td>"
                +"<td><a href ='delete.jsp?id="+rs.getInt("id")+"'>删除</a>");
        out.print("</tr>");

        }
    %>
        </tbody>
        </table>
           <div class="modal fade" id="modal-container-addUser" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
               <div class="modal-dialog">
                   <div class="modal-content">


    </div>
</div>
</div>
</div>
</div>
</div>

</body>
</html>
